# wget https://521github.com/extdomains/github.com/cilium/cilium-cli/releases/downlo
# ad/v0.16.4/cilium-linux-amd64.tar.gz

#! /bin/sh

get_cilium_cli() {
    arch="amd64"
    repo="cilium/cilium-cli"
    cli="cilium"
    version=$(curl -s https://api.github.com/repos/${repo}/tags | jq -r '.[0].name')
    echo "cilium_version: ${version}"
    bin_path="/usr/local/bin"
    file_name="${cli}-linux-${arch}.tar.gz"

    wget https://ghproxy.net/https://github.com/${repo}/releases/download/${version}/${file_name}
    tar -zxvf ${file_name}
    sudo rm -rf ${bin_path}/${cli}
    chmod +x ${cli}
    sudo mv ${cli} ${bin_path}
}
get_cilium_cli
